package com.project.Service.impl;


import com.project.Bean.ClassRoom;
import com.project.Bean.User;
import com.project.Service.IClassRoomService;
import com.project.mapper.IClassRoomMapper;
import com.project.mapper.IUserMapper;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/***
 * 班级实现类
 */
public class IClassRoomServiceImpl extends  BaseService implements IClassRoomService {

    @Override
    public List<ClassRoom> findAll() {
        SqlSession session = this.getSession();
        IClassRoomMapper mapper = session.getMapper(IClassRoomMapper.class);
        List<ClassRoom> list = mapper.findAll();
        session.close();
        return list;
    }
    @Override
    public void addClassRoom(ClassRoom classRoom) {
        SqlSession session = this.getSession();
        IClassRoomMapper mapper = session.getMapper(IClassRoomMapper.class);
        mapper.addClassRoom(classRoom);
        session.commit();
        session.close();
    }

    @Override
    public boolean delClassRoom(int id) {
        
        SqlSession session = this.getSession();
        IClassRoomMapper mapper = session.getMapper(IClassRoomMapper.class);
        mapper.delClassRoom(id);
        session.commit();
        session.close();
        return false;
    }
}
